<template>
  <div class="iconDom">
    <van-popup v-model="showdom" :close-on-click-overlay="false" position="bottom" class="van-popup">
      <van-grid class="iconBox3" :border="false" :column-num="2">
        <van-grid-item :icon="img1" text="微信" @click="shareHandle(0)" />
        <van-grid-item :icon="img2" text="朋友圈" @click="shareHandle(1)" />
      </van-grid>
      <div class="iconBox1" @click="cancleShow">取消</div>
    </van-popup>
  </div>
</template>

<script type="text/ecmascript-6">
import img1 from "./1.png";
import img2 from "./2.png";
export default {
  props: ["show"],
  data() {
    return {
      showdom: this.show,
      img1,
      img2
    };
  },
  watch: {
    show(n, o) {
 
      this.showdom = n;
    }
  },
  methods: {
    cancleShow() {
      this.showdom = false;
      this.$emit("setSHow", false);
    },
    shareHandle(i) {
      this.showdom = false;
      this.$emit("setSHow", false);
      if (i == 0) {
        alert("微信分享");
      } else {
        alert("朋友圈分享");
      }
    }
  }
};
</script>

<style scoped lang="less">
.van-popup {
  display: flex;
  flex-direction: column;
  padding: 0.1rem 0 0;
  width: 6.9rem;
  bottom: 1rem;
  left: 50%;
  margin-left: -3.45rem;
  border-radius: 0.1rem;
  .iconBox3 {
    flex: 4;
  }
  .iconBox1 {
    line-height: 0.9rem;
    border-top: 0.01rem solid rgba(229, 229, 229, 1);
    text-align: center;
    font-size: 0.3rem;
    color: rgba(39, 41, 55, 1);
  }
}
</style>
